<template>
  <a-layout id="components-layout-demo-custom-trigger">
    <a-layout-sider
      theme="light"
      v-model="collapsed"
      :trigger="null"
      collapsible
    >
      <div class="logo">
        <span v-if="!collapsed">学生管理系统</span>
      </div>
      <a-menu mode="inline" :default-selected-keys="['1']">
        <a-menu-item key="1">
          <router-link to="/" />
          <a-icon type="user" />
          <span>学生列表</span>
        </a-menu-item>
        <a-menu-item key="2">
          <router-link to="/searchStudent" />
          <a-icon type="search" />
          <span>查询学生</span>
        </a-menu-item>
        <a-menu-item key="3">
          <router-link to="/addStudent" />
          <a-icon type="plus" />
          <span>添加学生</span>
        </a-menu-item>
        <a-menu-item key="4">
          <router-link to="/about" />
          <a-icon type="upload" />
          <span>关于我们</span>
        </a-menu-item>
      </a-menu>
    </a-layout-sider>
    <a-layout>
      <a-layout-header style="background: #fff; padding: 0">
        <a-icon
          class="trigger"
          :type="collapsed ? 'menu-unfold' : 'menu-fold'"
          @click="() => (collapsed = !collapsed)"
        />
      </a-layout-header>

      <a-layout-content
        :style="{
          background: '#fff',
          minHeight: '280px',
        }"
      >
        <router-view />
      </a-layout-content>

      <a-layout-footer style="background: #fff; text-align: center">
        Thanks for Min!
      </a-layout-footer>
    </a-layout>
  </a-layout>
</template>
<script>
export default {
  name: 'APP',
  data() {
    return {
      collapsed: false,
    }
  },
}
</script>
<style>
#components-layout-demo-custom-trigger .trigger {
  font-size: 18px;
  line-height: 64px;
  padding: 0 24px;
  cursor: pointer;
  transition: color 0.3s;
}

#components-layout-demo-custom-trigger .trigger:hover {
  color: #409eff;
}

#components-layout-demo-custom-trigger .logo {
  height: 30px;
  background: #409eff;
  margin: 16px;
  text-align: center;
  font-size: 18px;
  color: aliceblue;
}
</style>
